/**
 * Candidate number: 35834
 * Builder class to create Matrix Atom Button and set initial phase/channel/step.
 */
package tv.starfu.sequencer.matrix;

import de.lessvoid.nifty.builder.ControlBuilder;

/**
 * Extend the generic Control Builder.
 * Named the control 'matrixAtomControl'
 * @author niadzi
 */
public class MatrixAtomBuilder extends ControlBuilder {
  public MatrixAtomBuilder() {
    super("matrixatom");
   // MatrixAtom ma = new MatrixAtom
  }
  
  /**
   * New control with uniques ID.
   * @param id  unique ID for the controller to recognise
   */
  public MatrixAtomBuilder(final String id) {
    super(id, "matrixatom");
  }

  /**
   * Set phase
   * @param initPhase 
   */
  public void setPhase(final int initPhase) {
      String phaseString = Integer.toString(initPhase);
      set("phase", phaseString);
  }

  public void setChannel(final String channelID) {
      set("channel", channelID);
  }

  public void setStep(final String stepID) {
      set("step", stepID);
  }

  public void addImage(final String filename) {
    String imageList = get("imageList");
    if (imageList == null || imageList.length() == 0) {
      set("imageList", filename);
      return;
    }
    set("imageList", imageList + "," + filename);
  }
}
